package com.agile.leetcode.bytecode;

/**
 * @Author ChenZhangKun
 * @Date 2020/9/2 9:30
 */
public class ByteCode {
    public void method() {
        int[] array = {1, 2, 3, 4, 5, 6, 7};
        int i = array[3];
        System.out.println(i);
    }
}

class Parent {

    public Parent() {
        System.out.println("Parent的构造方法");
    }

    static {
        System.out.println("Parent的静态代码块");
    }

    {
        System.out.println("Parent的构造代码块");
    }
}

class Son extends Parent {
    public Son() {
        System.out.println("Son的构造方法");
    }

    static {
        System.out.println("Son的静态代码块");
    }

    {
        System.out.println("Son的构造代码块");
    }

    public static void main(String[] args) {
        System.out.println("main方法");
        new Son();
    }
}

class Test {
    public static void main(String[] args) {
        System.out.println("main方法");
        new Son();
    }
}
